<!DOCTYPE html>
<html>
<#include "../include/resource.html">
<body>
	<#assign nid="member"> 
	<#include "../include/header.html">
	<!--header-end-->
	<!--用户中心的主栏目 开始-->
	<div id="main" class="clearfix" style="margin-top:10px;">
		<div class="wrap950 " style="margin-top:0">
			<!--左边的导航 开始-->
			<div class="user_left"><#include "user_menu.html"></div>
			<!--左边的导航 结束--> 
			
			<!--右边的内容 开始-->
			
			<div class="user_right">
				<div class="user_right_menu">
					<ul id="tab" class="list-tab clearfix">
						<li class="active"><a href="/memberPasswordToken/modifyPasswordToken.html">密保设置</a></li>
					</ul>
				</div>
				<div class="user_right_main">
				<!-- v1.6.7.2 RDPROJECT-505 zza 2013-12-05 start -->
				<#if msg??>
				<div id="msg24">
					<p class="ok">${msg}</p>
				</div>
				<#else> 
					<#if errormsg??>
					<div id="msg25">
						<p class="error">${errormsg}</p>
					</div>
					</#if> 
				</#if> 
				<!-- v1.6.7.2 RDPROJECT-505 zza 2013-12-05 end -->
				<!--修改登录密码 开始-->
				<div  id="protected" class="list-tab-con tab-pane fade in active">
                   <div class="list-tab-con tab-pane fade in active" id="userpwd">
						<form action="/memberPasswordToken/modifyPasswordToken.html" name="form1" method="post" onsubmit="return checkVal()" >
	                   		<div class="user_help alert alert">密保问题用于以后找回密码，保存后无法修改，请牢记您设置的问题与答案！</div>
							<div class="user_right_border">
								<div class="e">密保问题一：</div>
								<div class="c">
									<#if map??&&map.passwordToken1??>
										<@linkage name="passwordToken1" id="passwordToken1" default=map.passwordToken1 type="value" nid="password_token"/>
									<#else>
										<@linkage name="passwordToken1" id="passwordToken1" type="value" nid="password_token"/>
									</#if>
									<span class="check1"></span>
								</div>
							</div>
							<div class="user_right_border">
								<div class="e">答案一：</div>
								<div class="c">
									<input type="text" name="answer1" />
								</div>
							</div>
							<div class="user_right_border">
								<div class="e">密保问题二：</div>
								<div class="c">
									<#if map??&&map.passwordToken2??>
										<@linkage name="passwordToken2" id="passwordToken2" default=map.passwordToken2 type="value" nid="password_token"/>
									<#else>
										<@linkage name="passwordToken2" id="passwordToken2" type="value" nid="password_token"/>
									</#if>
									<span class="check2"></span>
								</div>
							</div>
							<div class="user_right_border">
								<div class="e">答案二：</div>
								<div class="c">
									<input type="text" name="answer2" />
								</div>
							</div>
							<div class="user_right_border">
								<div class="e">密保问题三：</div>
								<div class="c">
									<#if map??&&map.passwordToken3??>
										<@linkage name="passwordToken3" id="passwordToken3" default=map.passwordToken3 type="value" nid="password_token"/>
									<#else>
										<@linkage name="passwordToken3" id="passwordToken3" type="value" nid="password_token"/>
									</#if>
									<span class="check3"></span>
								</div>
							</div>
							<div class="user_right_border">
								<div class="e">答案三：</div>
								<div class="c">
									<input type="text" name="answer3" />
								</div>
							</div>
							<div class="user_right_border">
								<div class="c" style="margin-left:135px;">
									<input type="hidden" name="type" value="add"/> 
									<input type="submit" class="btn-action" name="submit" id="checkbtn" value="确认提交" size="30" /> 
								</div>
							</div>
						</form>
					</div>
					<div class="user_right_foot alert">
					* 温馨提示：我们将严格对用户的所有资料进行保密
					</div>
				</div>
				</div>
				<!--右边的内容 结束-->
			</div>
			
			
		</div>
	</div>
	<!--用户中心的主栏目 结束-->
	<script
		src="${request.getContextPath()}${theme_dir}/media/js/modal.js"></script>

	<script>
		$(function(){
			function checkVal(){
				var mb1 = $("select[name='passwordToken1']");	
				var mb2 = $("select[name='passwordToken2']");
				var mb3 = $("select[name='passwordToken3']");
				var anser1 = $("input[name='answer1']");
				var anser2 = $("input[name='answer2']");
				var anser3 = $("input[name='answer3']");
				var mbVal1,mbVal2,mbVal3;
				var mbVal1 = mb1.val();
				var mbVal2 = mb2.val();
				var mbVal3 = mb3.val();
				var btn = $("#checkVal");
				//mb1 = function(){
					mb1.change(function(){
						
						mbVal1 =  $(this).val();
						console.log(mbVal1)
						return mbVal1;
					});
					mb2.change(function(){
						mbVal2 =  $(this).val();
						if(mbVal1==mbVal2)
						{
							alert("密保问题不能一样")
						}
						console.log(mbVal2)
						return mbVal2;
					});
					mb3.change(function(){
						mbVal3 =  $(this).val();
						if(mbVal1==mbVal2==mbVal3)
						{
							alert("密保问题不能一样")
						}
						console.log(mbVal3)
					});
					console.log(btn)
					btn.click(function(){
						if(mbVal1==mbVal2==mbVal3)
						{
							alert("密保问题不能一样");
							return false;
						}
						
					})
					
				//}
			}
			checkVal();
		});
		
		function userName(){
            var passwordToken1 = $("#passwordToken1");
            var passwordToken2 = $("#passwordToken2");
            var passwordToken3 = $("#passwordToken3");
            var check1 = $(".check1");
            var check2 = $(".check2");
            var check3 = $(".check3");
            var str1;
            var str2;
            var str3;
            check1.blur(function(){
            	str1 = passwordToken1.val();
            	str2 = passwordToken2.val();
            	if(str1==str2) {
            		check1.text("密保问题有重复！");
            		return false;
            	}
            })
            check2.blur(function(){
            	str2 = passwordToken2.val();
            	str3 = passwordToken3.val();
            	if(str2 == str3) {
            		check2.text("密保问题有重复！");
            		return false;
            	}
            })
            check3.blur(function(){
            	str1 = passwordToken1.val();
            	str3 = passwordToken3.val();
            	 if(str3 == str1) {
            		check3.text("密保问题有重复！");
            		return false;
            	}
            })
            userName();
        }
	</script>
	<#include "../include/footer.html">
</body>
</html> 